package com.sokal.easycare.modules.product.service.factory;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sokal.easycare.common.service.TreeService;
import com.sokal.easycare.common.utils.StringUtils;
import com.sokal.easycare.modules.product.entity.factory.ProFactory;
import com.sokal.easycare.modules.product.dao.factory.ProFactoryDao;

/**
 * 生产厂家Service
 * @author liliangdong
 * @version 2017-03-12
 */
@Service
@Transactional(readOnly = true)
public class ProFactoryService extends TreeService<ProFactoryDao, ProFactory> {

	public ProFactory get(String id) {
		return super.get(id);
	}
	
	public List<ProFactory> findList(ProFactory proFactory) {
		if (StringUtils.isNotBlank(proFactory.getParentIds())){
			proFactory.setParentIds(","+proFactory.getParentIds()+",");
		}
		return super.findList(proFactory);
	}
	
	@Transactional(readOnly = false)
	public void save(ProFactory proFactory) {
		super.save(proFactory);
	}
	
	@Transactional(readOnly = false)
	public void delete(ProFactory proFactory) {
		super.delete(proFactory);
	}
	
}